#include <iostream>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>

int main() {
    // stdout -> 1
    printf("hello printf 1\n");
    fprintf(stdout, "hello fprintf 1\n");

    // stderr -> 2
    perror("hello perror 2"); // stderr

    const char *sl = "hello write 1\n";
    write(1, sl, strlen(sl));

    const char *s2 = "hello write 2\n";
    write(2, s2, strlen(s2));

    // cout -> 1
    std::cout << "hello cout 1" << std::endl;

    // cerr -> 2
    std::cerr << "hello cerr 2" << std::endl;

    return 0;
}
